package com.xlh.thread;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;
import android.os.Message;

import com.xlh.Utils.HttpHelper;

import com.xlh.conf.CommonConf;
import com.xlh.interf.IUiUpdateHandler;

import com.xlh.outside.R;
import com.xlh.interf.IUiUpdateHandler;
public class GetServerTask implements Runnable{
	 

	
	public Context context = null;
	public String userAccount;
	public String userPassword;
	private int type;
	
	
	public GetServerTask(Context contxt,int type){
		this.context = contxt;
		this.type = type;
	}
	
	public Context getContext() {
		return context;
	}

	public void setContext(Context context) {
		this.context = context;
	}


	@Override
	public void run() {
		// TODO Auto-generated method stub
		 try {
			 
			 Message msg = new Message();
             String rest = HttpHelper.sendGet(CommonConf.webApi,"m=api&c=server&a=lists");
             
             Bundle data = new Bundle();
             data.putString("rest", rest);
            
     		 msg.setData(data);
     		
     		 ((IUiUpdateHandler)context).getHandler().sendMessage(msg);
     		 
		} catch (Exception e) {
			//LogUtil.getIns(context).info("Login:error-"+e.getMessage());
		}
	}}
